package cn.wolfcode.springboot_consumer._01_hello;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 自己写一个类,去交给spring进行管理
 * 这个类上要贴上一个@RocketMQMessageListener注解,
 * 还有实现RocketMQListener接口
 */
@Component
@RocketMQMessageListener(
        consumerGroup = "boot-consumer-demo",
        topic = "01-boot-hello",
        selectorType = SelectorType.SQL92,
        selectorExpression = "age>15"

)
public class Consumer implements RocketMQListener<String> {


    @Override
    public void onMessage(String message) {
        System.out.println("消息内容是:"+message);
    }
}
